package com.hqyj.module.clock.dao;

import com.hqyj.module.clock.pojo.UserInfo;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

/**
 * @author lap
 * @version 1.0
 * @date 2021/9/30 13:07
 */
@Component
public interface UserInfoDao {

    @Select("select * from user_info where user_name=#{userName}")
    UserInfo selectUserInfo(String userName);

    @Select("select lateandearly_num from user_info where user_id=#{userId}")
    Integer getLateAndEarly(Integer userId);

    @Update("UPDATE user_info set lateandearly_num = lateandearly_num-1 where user_id = #{userId} ")
    Integer updateLateAndEarly(Integer userId);
}
